<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        let array = [1, 2, 5, 3, 7, 664, 63, 65, 53, 62]
        for (let i=0;i<array.length;i++){
            let min = i
            for (let j = i+1;j<array.length;j++){
                if (array[min] > array[j]){
                    min = j
                }
            }
            let tmp = array[min]
            array[min] = array[i]
            array[i] = tmp
        }
        console.log(array)

    </script>
</body>
</html>